import service from "@/server/serviceIndex";
// 根据用户id查询用户浏览商品历史 - 实体店;
export const getShopHistoryAPI = (page, limit, userId) => {
    return service({
        method: "get",
        url: `/pipayshopapi/store-commodity-history/history/${page}/${limit}/${userId}`,
    });
};

// 发布实体店商品
export const issueShopCommodityAPI = (data) => {
    return service({
        method: "post",
        url: `/pipayshopapi/store-commodity-info/issueShopCommodity`,
        data,
    });
};
//修改实体店商品
export const updateShopCommodityAPI = (data) => {
    return service({
        method: "POST",
        url: "/pipayshopapi/store-commodity-info/updateCommodityStatus",
        data
    })
};
// 实体店商品轮播图上传
export const shopCommodityImageUp = (data) => {
    return service({
        method: "post",
        url: `/pipayshopapi/store-commodity-info/shopCommodityImageUp`,
        headers: { "Content-Type": "multipart/form-data" },
        data,
    });
};

// 根据商品id获取商品库存网店
export const getInventoryByCommodityIdAPI = (CommodityId) => {
    return service({
        method: "get",
        url: `/pipayshopapi/commodity/getInventoryByCommodityId/${CommodityId}`,
    });
};

// 根据商品id获取商品库存实体店
export const getResidueByCommodityIdAPI = (CommodityId) => {
    return service({
        method: "get",
        url: `/pipayshopapi/store-commodity-info/getResidueByCommodityId/${CommodityId}`,
    });
};

// 新增用户浏览网店商品的历史记录
export const addHistoryAPI = (commodityId, userId) => {
    return service({
        method: "post",
        url: `/pipayshopapi/store-commodity-history/addHistory`,
        params: {
            commodityId,
            userId,
        },
    });
};
//查询是否启用自动汇率功能
export const enableRateAPI = () => {
    return service({
        url: "/pipayshopapi/configuration/getEnabledPi",
        method: "GET"
    })
}